<?php 
$queryString=(isset($_GET['App']))?'&':'?';

$isMake=0;
				$isMake_1=0;
				if(!stristr($_SERVER['REQUEST_URI'],"?Sort=")==FALSE){
					
					$url=explode("?Sort=",$_SERVER['REQUEST_URI']);
					$isMake=1;
				}
				else
				{
					if(!stristr($_SERVER['REQUEST_URI'],"&Sort=")==FALSE){
					
					$url=explode("&Sort=",$_SERVER['REQUEST_URI']);
					$isMake_1=1;
					}
				}


?>

<div id="content">
<div id="main">

<table id="sorting" border="0" align="right">
	<tr>
		<td>
			Sort By:
		</td>
		<td>
        
			<a href="<?php  if($isMake==1){echo $url[0].'?';}else if($isMake_1==1){echo $url[0].'&';}else{echo $_SERVER['REQUEST_URI'].$queryString; }?>Sort=Year&App">Year</a> |
		</td>
		<td>
			<a href="<?php  if($isMake==1){echo $url[0].'?';}else if($isMake_1==1){echo $url[0].'&';}else{echo $_SERVER['REQUEST_URI'].$queryString; }?>Sort=Make&App">Make</a>  |
		</td>		
		<td>
			<a href="<?php  if($isMake==1){echo $url[0].'?';}else if($isMake_1==1){echo $url[0].'&';}else{echo $_SERVER['REQUEST_URI'].$queryString; }?>Sort=Model&App">Model</a>  |
		</td>		
		<td>
			<a href="<?php  if($isMake==1){echo $url[0].'?';}else if($isMake_1==1){echo $url[0].'&';}else{echo $_SERVER['REQUEST_URI'].$queryString; }?>Sort=Mileage&App">Mileage</a> |
		</td>		
		<td>
			<a href="<?php  if($isMake==1){echo $url[0].'?';}else if($isMake_1==1){echo $url[0].'&';}else{echo $_SERVER['REQUEST_URI'].$queryString; }?>Sort=Price&App">Price</a> 
		</td>		
	</tr>
</table>
    <?php include_once 'imageholder.php';?>
</div>
</div>